import request from '@/utils/request'

// 查询部门列表
export function listPost(query) {
  return request({
    url: '/system/post/list',
    method: 'get',
    params: query
  })
}
export function allPost(query) {
  return request({
    url: '/system/post/list',
    method: 'get',
    params: query
  })
}



export function getPostlist(query) {
  return request({
    url: '/system/post/getPostlist',
    method: 'get',
    params: query
  })
}


export function getSelectPostlist(query) {
  return request({
    url: '/webApi/nologin/getPostlist',
    method: 'get',
    params: query
  })
}


// 查询部门列表（排除节点）
export function listPostExcludeChild(postId) {
  return request({
    url: '/system/post/list/exclude/' + postId,
    method: 'get'
  })
}

// 查询部门详细
export function getPost(postId) {
  return request({
    url: '/system/post/' + postId,
    method: 'get'
  })
}

// 新增部门
export function addPost(data) {
  return request({
    url: '/system/post',
    method: 'post',
    data: data
  })
}

// 修改部门
export function updatePost(data) {
  return request({
    url: '/system/post',
    method: 'put',
    data: data
  })
}

// 删除部门
export function delPost(postId) {
  return request({
    url: '/system/post/' + postId,
    method: 'delete'
  })
}
